add_gdal_driver(TARGET gdal_OZI SOURCES ozidataset.cpp PLUGIN_CAPABLE_IF "NOT GDAL_USE_ZLIB_INTERNAL" NO_DEPS)
gdal_standard_includes(gdal_OZI)
target_compile_definitions(gdal_OZI PRIVATE -DHAVE_LIBZ -DZIP_SUPPORT)
if (GDAL_USE_ZLIB_INTERNAL)
  gdal_add_vendored_lib(gdal_OZI libz)
else ()
  target_compile_definitions(gdal_OZI PRIVATE -DHAVE_ZLIB_H -DHAVE_ZLIB)
  gdal_target_link_libraries(gdal_OZI PRIVATE ZLIB::ZLIB)
  if (MSVC)
    target_compile_definitions(gdal_OZI PRIVATE -DZLIB_DLL)
  endif ()
endif ()
